package org.example.workbench.service.impl;

import org.example.workbench.domain.Contacts;
import org.example.workbench.domain.Customer;
import org.example.workbench.mapper.CustomerMapper;
import org.example.workbench.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("CustomerService")
public class CustomerImpl implements CustomerService {
    @Autowired
    private CustomerMapper customerMapper;

    @Override
    public Customer getCustomerDetailByName(String name) {
        return customerMapper.getCustomerDetailByName(name);
    }

    @Override
    public Customer getCustomerDetailById(String id) {
        return customerMapper.getCustomerDetailById(id);
    }

    @Override
    public int deleteCustomerByIds(String[] id) {
        return customerMapper.deleteCustomerByIds(id);
    }

    @Override
    public int updateOneCustomerByMap(Map<String, Object> map) {
        return customerMapper.updateOneCustomerByMap(map);
    }

    @Override
    public Customer getCustomerById(String id) {
        return customerMapper.getCustomerById(id);
    }

    @Override
    public int getCustomerTotalCountByMap(Map<String, Object> map) {
        return customerMapper.getCustomerTotalCountByMap(map);
    }

    @Override
    public List<Contacts> getAllCustomerByMap(Map<String, Object> map) {
        return customerMapper.getAllCustomerByMap(map);
    }

    @Override
    public int insertOneCustomerByMap(Map<String, Object> map) {
        return customerMapper.insertOneCustomerByMap(map);
    }

    @Override
    public List<Customer> getCustomerByName(String name) {
        return customerMapper.getCustomerByName(name);
    }
}
